//
//  JSMStrategyContinentTableViewCell.m
//  TakeYouTourTogether
//
//  Created by king on 15/12/5.
//  Copyright © 2015年 king. All rights reserved.
//

#import "JSMStrategyContinentTableViewCell.h"

@implementation JSMStrategyContinentTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createStrategyContinentTableViewCell];
    }
    return self;
}

- (void)createStrategyContinentTableViewCell {
    self.myImageView = [[BaseImageView alloc] init];
    self.myImageView.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.myImageView];
    
    
    self.myLabel = [[BaseLabel alloc] init];
    self.myLabel.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.myLabel];
    self.myLabel.font = [UIFont boldSystemFontOfSize:20];
    self.myLabel.textColor = [UIColor whiteColor];
    self.myLabel.highlightedTextColor = [UIColor whiteColor];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:21], NSFontAttributeName, nil];
    CGRect rect = [self.myLabel.text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH-80, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    self.myImageView.frame = CGRectMake(0, 0, TABLEVIEWCELL_WIDTH, self.TABLEVIEWCELL_HEIGHT);
    self.myLabel.frame = CGRectMake(0, 0, rect.size.width, 30);
    self.myLabel.center = self.myImageView.center;
}

@end
